import {ServicePrefixEnum} from "@/enums/commonEnum";
import {RequestEnum} from "@/enums/httpEnum";
import {defHttp} from "@/utils/http/axios";
import type { AxiosRequestConfig } from 'axios';
export interface MailLogVO {
  id: number
  userId: number
  userType: number
  toMail: string
  accountId: number
  fromMail: string
  templateId: number
  templateCode: string
  templateNickname: string
  templateTitle: string
  templateContent: string
  templateParams: string
  sendStatus: number
  sendTime: Date
  sendMessageId: string
  sendException: string
}
const  MODULAR = '/system/mail-log'
export const Api = {

  GetMailLogPage: {
    url: `${ServicePrefixEnum.BASE}/${MODULAR}/page`,
    method: RequestEnum.GET,
  } as AxiosRequestConfig,
  GetMailLog: {
    url: `${ServicePrefixEnum.BASE}/${MODULAR}/get`,
    method: RequestEnum.GET,
  } as AxiosRequestConfig,

}


// 查询邮件日志列表
export const getMailLogPage =(params: PageParam) => {
  return defHttp.request({ ...Api.GetMailLogPage,params: params })
}

// 查询邮件日志详情
export const getMailLog =  (id: number) => {
  let params = { id: id }
 return defHttp.request({ ...Api.GetMailLog,params: params })
}
